home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
wtek0693.zip
/
OOPALLEY.ZIP
/
BAG.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-04-27
|
2KB
|
44 lines
#ifndef BAG_H
#define BAG_H
#include "collect.h"
#include "dict.h"
extern const Class class_Bag;
////////////////////////////////////////////////////////////
// class Bag (declaration)
////////////////////////////////////////////////////////////
class Bag: public Collection {
unsigned count;
Dictionary contents;
public:
// constructors, destructors
Bag(unsigned size =CLTN_DEFAULT_CAPACITY);
Bag(const Bag&);
// operators
bool operator!=(const Bag& a) const { return !(*this==a); }
void operator=(const Bag&);
bool operator==(const Bag&) const;
Object* addWithOccurrences(const Object&, unsigned);
virtual Object* add(const Object&);
virtual Collection& addContentsTo(Collection&) const;
virtual Object*& at(int) const;
virtual unsigned capacity() const;
virtual void deepenShallowCopy();
virtual Object* doNext(Iterator&) const;
virtual unsigned hash() const;
virtual const Class* isA() const;
virtual bool isEqual(const Object&) const;
virtual unsigned occurrencesOf(const Object&) const;
virtual void printOn(ostream& strm) const;
virtual void reSize(unsigned);
virtual Object* remove(const Object&);
virtual unsigned size() const;
virtual const Class* species() const;
};
#endif